package com.example.damaimaven.controller;

import com.example.damaimaven.entity.Category;
import com.example.damaimaven.mapper.CategoryMapper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * <p>
 *  前端控制器
 * </p>
 *
 * @author zzh
 * @since 2024-07-09
 */
@RestController
@RequestMapping("/category")
public class CategoryController {

    @Autowired
    CategoryMapper categoryMapper;

    @RequestMapping("queryAll")
    public List<Category> queryAll(){
        // selectList 不能关联查询
        return categoryMapper.selectAll();
    }
}
